using System;
using System.Collections.Generic;
using System.Text;

namespace Eve.Data
{
    public class SecurityRating : EveAssociation<SolarSystem, SolarSystem>
    {
        private double fromValue;
        private double toValue;

        public SolarSystem FromSolarSystem
        {
            get { return From; }
        }
        public SolarSystem ToSolarSystem
        {
            get { return To; }
        }
        public double FromSecurityRating
        {
            get { return fromValue; }
        }
        public double ToSecurityRating
        {
            get { return toValue; }
        }

        internal SecurityRating(DbDataRow dr)
            : base(dr.Database, new SolarSystem(dr.Database, dr["fromSolarSystemID"]), new SolarSystem(dr.Database, dr["toSolarSystemID"]))
        {
            Fill(dr);
        }
        internal SecurityRating(DbDataRow dr, SolarSystem from)
            : base(dr.Database, from, new SolarSystem(dr.Database, dr["toSolarSystemID"]))
        {
            Fill(dr);
        }

        private void Fill(DbDataRow dr)
        {
            fromValue = dr["fromValue"];
            toValue = dr["toValue"];
        }
    }
}
